<!DOCTYPE html>
<html>

	<head lang="en">
		<meta charset="UTF-8">
		<title>练习一</title>

	</head>

	<body>
		<script type="text/javascript" language="JavaScript">
			var fruit = "America,Greece,Britain,Canada,China,Egypt";
		var arr = fruit.split(",");
			var j = 0;
			for(var i in arr) {
				document.writeln(arr[i]+"<br />")
				if(arr[i].indexOf("a") != -1 ||arr[i].indexOf("A") != -1) {
					j++;
				}
				document.write("<hr />")
			}
			document.write("共有" + j + "个字符包含a或A")
		</script>
	</body>

</html>
